﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace DockSample
{
    public class NonFunctionRequirment
    {
        public string id;
        //对应的约束对象(可能是对象图，方法，属性)的ID
        public string objId;
        //new
        //保存NFR的图形表示
        OriginalNFRChartType chartType = null;
        public OriginalNFRChartType ChartType
        {
            get { return chartType; }
            set { chartType = value; }
        }
        //new
        private string unit = null;
        public string Unit
        {
            get { return unit; }
            set { unit = value; }
        }
        /*private string associationType;
        public string AssociationType
        {
            get { return associationType; }
            set { associationType = value; }
        }

        private string associationTarget;
        public string AssociationTarget
        {
            get { return associationTarget; }
            set { associationTarget = value; }
        }*/
        //


        public string nonFunctionType;
        public string NonFunctionType
        {
            get { return nonFunctionType; }
            set { nonFunctionType = value; }
        }
        //
        public string nonFunctionName;
        public string NonFunctionName
        {
            get { return nonFunctionName; }
            set { nonFunctionName = value; }
        }
        //
        public string nonFunctionValue;
        public string NonFunctionValue
        {
            get { return nonFunctionValue; }
            set { nonFunctionValue = value; }
        }
        //
        public string description;
        public string Description
        {
            get { return description; }
            set { description = value; }
        }
      
        //###################################################################################
        public NonFunctionRequirment(string nonFunctionType, string nonFunctionName, string nonFunctionValue, string description = "")
        {
            this.nonFunctionType = nonFunctionType;
            this.nonFunctionName = nonFunctionName;
            this.nonFunctionValue = nonFunctionValue;
            this.description = description;
            this.id = System.Guid.NewGuid().ToString();
        }

        public NonFunctionRequirment(string nonFunctionType, string nonFunctionName, string nonFunctionValue, 
            string id, string description = "")
        {
            this.nonFunctionType = nonFunctionType;
            this.nonFunctionName = nonFunctionName;
            this.nonFunctionValue = nonFunctionValue;
            this.description = description;
            this.id = id;
        }

        //***********************************************************************************
        public override string ToString()
        {
            return nonFunctionName + ":" + nonFunctionValue + ";" + description;
        }
        public string getShowString()
        {
            /*string showStr = "";
            switch (nonFunctionType)
            {
                case "Quantifiable":
                    showStr = "+";
                    break;
                case "UnQuantifiable":
                    showStr = "-";
                    break;
                default:
                    showStr = "";
                    break;
            }*/
            return nonFunctionName + ":" + nonFunctionValue;
        }
    }
}
